<template>
  <div class="padding">
    <div class="top">
      <li>创建房间</li>
      <li>房主榜</li>
    </div>
    <div class="middle">
      <div class="title">猜你喜欢</div>
      <div class="content">
        <ul v-if="arr.length > 0">
          <li v-for="(v, i) in arr" :key="i" :style="v.libgiurl">
            <div>
              <i :class="v.iconfont"></i>
              <p>{{ v.title }}</p>
              <span>热度{{ v.redu }}</span>
            </div>
          </li>
        </ul>
      </div>
    </div>
    <div class="bottom">
      <div class="title">为你推荐</div>
      <div class="list">
        <div class="item" v-for="(v, i) in wntjarr" :key="i">
          <div class="b_top">
            <p>{{ v.top_title }}</p>
            <span>
              <i></i>
              <span>{{ v.top_span }}</span>
            </span>
          </div>
          <div class="b_mid">
            <p>{{ v.mid_title }}</p>
          </div>
          <div class="b_bot">
            <div></div>
            <span>{{ v.bot_num }}人</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      // style: "",
    };
  },
  created() {
    this.$store.dispatch("getcnxh");
    this.$store.dispatch("getwntj");
    // this.style = "width:" + this.$store.state.ygefang.cnxh.length * 2.3 + "rem";
  },
  computed: {
    arr() {
      return this.$store.state.ygefang.cnxh;
    },
    wntjarr() {
      return this.$store.state.ygefang.wntj;
    },
  },
  components: {},
  methods: {},
};
</script>
<style lang="less" scoped>
.padding {
  width: 100%;
  padding: 0.15rem 0 0.15rem 0.3rem;
  background-color: #f6f6f6;
  .top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    li {
      width: 3.35rem;
      height: 0.8rem;
      background-color: #f5e9f3;
      font-size: 0.28rem;
      text-align: center;
      line-height: 0.8rem;
      border-radius: 0.2rem;
    }
  }
  .middle {
    width: 100%;
    height: 3.15rem;
    .title {
      font-size: 0.28rem;
      font-weight: bold;
      margin-bottom: 0.25rem;
    }
    .content {
      width: 100%;
      overflow: auto;
      ul {
        // width: 12rem;
        display: flex;
        li {
          flex-shrink: 0;
          width: 2.1rem;
          height: 2.1rem;
          position: relative;
          background: url(/img/wallhaven-rdyezm_看图王.jpg) no-repeat;
          background-size: 2.1rem 2.1rem;
          margin-right: 0.2rem;
          // border-radius: 0.16rem;
          div {
            border-radius: 0.16rem;

            position: absolute;
            top: 0;
            left: 0;
            width: 2.1rem;
            height: 2.1rem;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            padding: 0.25rem 0.4rem;
            text-align: center;
            i {
              // background-color: #f0483d;
              margin: 0 auto 0.3rem;
              border-radius: 50%;
              font-size: 0.65rem;
              display: block;
              text-align: center;
            }
            p {
              font-size: 0.22rem;
              margin-bottom: 0.1rem;
            }
            span {
              font-size: 0.18rem;
            }
          }
        }
      }
    }
  }
  .bottom {
    width: 100%;
    padding-right: 0.3rem;
    .title {
      font-size: 0.28rem;
      font-weight: bold;
      margin-bottom: 0.25rem;
    }
    .list {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      .item {
        color: #fff;
        position: relative;
        padding: 0.2rem;
        width: 3.35rem;
        height: 2.5rem;
        border-radius: 0.2rem;
        background-color: #95dca2;
        margin-bottom: 0.15rem;
        .b_top {
          display: flex;
          justify-content: space-between;
          margin-bottom: 0.2rem;
          p {
            padding: 0.1rem 0.15rem;
            background-color: #6ab68f;
            color: #fff;
            border-radius: 0.25rem;
            font-size: 0.18rem;
          }
          span {
            font-size: 0.24rem;
          }
        }
        .b_mid {
          p {
            font-size: 0.28rem;
          }
        }
        .b_bot {
          position: absolute;
          width: calc(100% - 0.4rem);
          display: flex;
          justify-content: space-between;
          bottom: 0.2rem;
        }
      }
    }
  }
}
::-webkit-scrollbar {
  display: none;
}
</style>